package model

import (
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Tel      string `gorm:"type:char(11)"json:"tel"`
	Password string `gorm:"type:char(32)"json:"password"`
	Name     string `gorm:"type:varchar(30)"json:"name"`
	Img      string `gorm:"type:varchar(500)"json:"img"`
}
type House struct {
	gorm.Model
	UserId  int     `gorm:"type:int(10)"json:"userId"`
	Title   string  `gorm:"type:varchar(30)"json:"title"`
	Content string  `gorm:"type:varchar(100)"json:"content"`
	Price   float64 `gorm:"type:decimal(10,2)"json:"price"`
	Address string  `gorm:"type:varchar(50)"json:"address"`
}
type Pre struct {
	gorm.Model
	UserId  int    `gorm:"type:int(10)"json:"userId"`
	HouseId int    `gorm:"type:int(10)"json:"houseId"`
	Status  string `gorm:"type:varchar(30)"json:"status"`
	Time    string `gorm:"type:datetime"json:"time"`
}
type Spek struct {
	gorm.Model
	UserId  int    `gorm:"type:int(10)"json:"userId"`
	HouseId int    `gorm:"type:int(10)"json:"houseId"`
	Text    string `gorm:"type:varchar(100)"json:"text"`
}
type HouseUser struct {
	House
	Name string `gorm:"type:varchar(30)"json:"name"`
}
type PreUser struct {
	Pre
	Name    string `gorm:"type:varchar(30)"json:"name"`
	Address string `gorm:"type:varchar(50)"json:"address"`
}
